/**
 * This file is part of Wireless TransFer.
 *
 *   Wireless TransFer is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *	
 *   Wireless TransFer is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with Wireless TransFer.  If not, see <http://www.gnu.org/licenses/>.
 *
 *	 Copyright (C) 2011
 *   @author ninjarobirob
 */

package com.wirelesstransfer.client;

import com.wirelesstransfer.connection.IConnection;
import com.wirelesstransfer.connection.ITransferData;

/**
 * ClientConnection to server
 *
 */

public class ClientConnection implements IConnection {
	
	private String ipAddress;
	private int port;
	private int code;
	private String sessionId;
	private ITransferData iTransferData;
	

	private static ClientConnection connection;
	
	/**
	 * Connection info to server
	 * @param ipAddress to server
	 * @param port to server
	 * @param code to autheticate to sevrev
	 * @param sessionId for this client
	 */
	public ClientConnection(String ipAddress, int port, int code, String sessionId, ITransferData iTrannsferData) {
		this.ipAddress = ipAddress;
		this.port = port;
		this.code = code;
		this.sessionId = sessionId;
		this.iTransferData = iTrannsferData;
	}
	
	public static void setInstance(String ipAddress, int port, int code, String sessionId, ITransferData iTransferData){
		connection = new ClientConnection(ipAddress, port, code, sessionId, iTransferData);
	}

	
	public static ClientConnection getInstance(){
		return connection;
	}
	
	public String getIP() {
		return ipAddress;
	}

	public int getPort() {
		return port;
	}

	public int getCode() {
		return code;
	}

	public String getSessionId() {
		return sessionId;
	}
	
	public ITransferData getTransferData(){
		return iTransferData;
	}
	
	
	
	
}
